<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <h1>h1</h1>
    <p>p1</p>
    <h2>h2</h2>
    <p>p2</p>
    <h3>h3</h3>
    <p>p3</p>

    <style>
        /*所以元素的第一个*/
        p:first-child{color: red;}
        /*所以同一类型p元素兄弟姐妹的第一个*/
        p:first-of-type{color: aqua;}
        p:last-child{color: brown;}
        p:last-of-type{color: blueviolet;}
        p:nth-child(4){color:blue}
        /*p:nth-of-type(){color:red}*/
    </style>
</body>
</html>